package com.ha8.netease.views.utils
{
	import com.ha8.netease.App;
	import com.ha8.netease.models.vo.UserModel;
	import com.ha8.netease.views.components.AlertWindow;
	import com.ha8.netease.views.components.UserToolTip;
	
	import flash.display.NativeWindowType;
	
	import mx.events.ToolTipEvent;

	/**
	 * ToolTip控制类
	 * @author caochangli
	 */	
	public class ToolTipUtil
	{
		private static var userModel:UserModel;
		
		/**
		 * UserToolTip
		 * 
		 * @param event:ToolTipEvent
		 * @param userModel:UserModel
		 */	
		public static function showUserTip(event:ToolTipEvent, userModel:UserModel):void
		{
			var userToolTip:UserToolTip = new UserToolTip();
			userToolTip.userModel = userModel;
			event.toolTip = userToolTip;
		}
		
		/**
		 * 消息提示
		 * 
		 * @param msg
		 */		
		public static function alert(msg:String):void
		{
			if (!App.getInstance().alertWindow)
			{
				App.getInstance().alertWindow = new AlertWindow();
				App.getInstance().alertWindow.type = NativeWindowType.UTILITY;
				App.getInstance().alertWindow.open();
			}
			App.getInstance().alertWindow.alert(msg);
		}
		
		
	}
}